{include file='public/header'}
  
  <body>
    <div class="x-body">
        <form class="layui-form" style="margin-top: 50px;">
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>资金调节
              </label>
              <input type="hidden" name="user_id" value="{$user_id}">
              <div class="layui-input-inline">
              <select name="cate">
                <option value="1">增加</option>
                <option value="2">减少</option>
              </select>
              </div>
              <div class="layui-input-inline">
                  <input type="text" id="L_repass" name="user_money" required="" lay-verify="required"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
              <button  class="layui-btn" lay-filter="save" lay-submit="">
                  确定
              </button>
          </div>
      </form>
    </div>
    <script>
            var url = '{:url("account")}';
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form
              ,layer = layui.layer;
              
              //监听提交
              form.on('submit(save)', function(data){
                // console.log(data.field);
                //发异步，把数据提交给php
                $.post(url,data.field,function(res){
                    // console.log(res);
                    if(res.code == 1){
                        layer.alert(res.msg, {icon: 6},function () {
                            // 获得frame索引
                            var index = parent.layer.getFrameIndex(window.name);
                            //关闭当前frame
                            parent.layer.close(index);
                            window.location.href = res.url;
                        });
                    }else{
                        layer.alert(res.msg, {icon: 5}); 
                    }
                },'json')
                return false;
              });
              
              
            });
        </script>

  </body>

</html>